package com.five.wisdomClass.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName("leave")
@AllArgsConstructor
@NoArgsConstructor
public class Leave implements Serializable {

    // id
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    // 学号
    @TableField(value = "s_number")
    private String sNumber;

    // 姓名
    @TableField(value = "s_name")
    private String sName;

    // 请假类型
    @TableField(value = "leave_type")
    private String leaveType;

    // 开始时间
    @TableField("start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "Asia/Shanghai")
    private Date startTime;

    // 结束时间
    @TableField("end_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "Asia/Shanghai")
    private Date endTime;

    // 联系方式
    private String contact;

    // 请假理由
    private String context;

    // 审核状态
    private Integer state;

    // 驳回理由
    private String reason;

    // 未审核
    public static final int NOAUDIT=0;
    // 审核通过
    public static final int PASS=1;
    // 审核未通过
    public static final int NOPASS=2;
}
